<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>更改HTML元素的onclick事件</title>
</head>
<body>
    <h1>JavaScript 事件</h1>
    <button onclick="document.getElementById('demo').innerHTML=Date()">点击显示时间</button>
    <p id="demo"></p>
</body>
</html>